# $Id$
# Maintainer: Christian Hesse <mail@eworm.de>
# Contributor: Rustam Tsurik <rustam.tsurik@gmail.com>
# Contributor: Nico Suarez <nicodoggie@gmail.com>

pkgname=galera
pkgver=25.3.24
pkgrel=1
pkgdesc='write set replication (WSREP) provider for MariaDB cluster'
arch=('x86_64')
license=('GPL2' 'custom:OpenSSL Linking Exception')
depends=('mariadb' 'openssl')
makedepends=('check' 'scons' 'boost')
optdepends=('rsync: transfer database state to a newly joined node with rsync')
url='http://www.codership.com/'
options=('!libtool')
validpgpkeys=('44B7345738EBDE52594DAD80D669017EBC19DDBA') # Codership Oy <info@galeracluster.com>
source=("http://releases.galeracluster.com/${pkgname}-${pkgver#25.}/source/${pkgname}-3-${pkgver}.tar.gz"{,.asc})
sha256sums=('b2ba22c9a785470ef488b84cd3a7b7b37544aafd658989bb709bd3cbd538d567'
            'SKIP')

build(){
  cd "${pkgname}-3-${pkgver}"

  scons system_asio=0
}

package(){
  cd "${pkgname}-3-${pkgver}"

  install -D -m0755 libgalera_smm.so "${pkgdir}"/usr/lib/galera/libgalera_smm.so
  ln -s galera/libgalera_smm.so "${pkgdir}"/usr/lib/libgalera_smm.so

  install -D -m0755 garb/garbd "${pkgdir}"/usr/bin/garbd

  install -D -m0644 scripts/packages/README "${pkgdir}"/usr/share/doc/galera/README
  install -D -m0644 scripts/packages/README-MySQL "${pkgdir}"/usr/share/doc/galera/README-MySQL
  install -D -m0644 scripts/mysql/README "${pkgdir}"/usr/share/doc/galera/mysql/README
  install -D -m0644 COPYING "${pkgdir}"/usr/share/doc/galera/COPYING
}

